// useRef + ts - 2.做引用稳定的存储器

import {useEffect, useRef} from "react";

function App() {
    const timerId = useRef<number | undefined>(undefined);

    useEffect(() => {
        timerId.current = setInterval(() => {
            console.log("123")
        }, 1000)

        return () => clearInterval(timerId.current)
    }, [])

    return (
        <div>
        </div>
    )
}

export default App
